package com.nttdata.ta.todo.feign;

import com.nttdata.ta.common.dto.ResponseResult;
import com.nttdata.ta.todo.config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(
    name = "user-service", 
    url = "${user-service.url:http://localhost:8081}", 
    path = "/api/users",
    configuration = FeignConfig.class
)
public interface UserServiceClient {
    
    @PostMapping("/validate")
    ResponseResult<Boolean> validateToken(@RequestHeader("Authorization") String authHeader);
    
    @GetMapping("/id-from-token")
    ResponseResult<Long> getUserIdFromToken(@RequestHeader("Authorization") String authHeader);
} 